package game.test;

import chess.Tile;

/**
 * This class is used by the eight queen simulator class to help in testing if
 * a piece is to be placed in on the square or to be removed. A tile can have one of three status.
 * They are as follows:
 * <pre> 
 * PLACE_PIECE = piece to be placed on tile
 * REMOVE_PIECE = piece at the tile is to be removed 
 * INVALID_PIECE = piece cannot be place on tile
 * </pre>
 * @author Caleb Chan
 * - Created February 16, 2010
 */
public class EightQueensSimulatorTileInfo {
	
	public static final int PLACE_PIECE = 0;
	public static final int REMOVE_PIECE = 1;
	public static final int INVALID_PIECE = 2;
	
	private Tile tile;
	private int status;
	
	/**
	 * The main constructor for this class
	 * @param tile The tile that is going to be affected
	 * @param status The how placing a piece will affect the tile
	 * <pre>
     * Caleb Chan
     * - Created February 16, 2010
     * </pre>
	 */
	public EightQueensSimulatorTileInfo(Tile tile,int status){
		this.tile = tile;
		this.status = status;
	}
	/**
	 * A getter for the tile object held by this class
	 * @return Returns a tile object
	 * <pre>
     * Caleb Chan
     * - Created February 16, 2010
     * </pre>
	 */
	public Tile getTile() {
		return tile;
	}
	/**
	 * A getter for the status of this object
	 * @return Returns the status of the class
	 * <pre>
     * Caleb Chan
     * - Created February 16, 2010
     * </pre>
	 */
	public int getStatus() {
		return status;
	}
	/**
	 * Creates a string representation of this class
	 * @return Returns a string representation of this class
	 * <pre>
     * Caleb Chan
     * - Created February 16, 2010
     * </pre>
	 */
	public String toString(){
		if(status == EightQueensSimulatorTileInfo.PLACE_PIECE){
			return "Tile : " + tile.toString() + " Status : Piece Placed"; 
		}else if (status == EightQueensSimulatorTileInfo.REMOVE_PIECE){
			return "Tile : " + tile.toString() + " Status : Piece Remove"; 
		}else{
			return "Tile : " + tile.toString() + " Status : Invalid Move"; 
		}
	}
}
